//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class HeaderFooter: IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read("headerFooter"))
            {
                _differentOddEven = c.GetOptionalBoolean ("differentOddEven", false);
                _differentFirst = c.GetOptionalBoolean("differentFirst", false);
                scaleWithDoc = c.GetOptionalBoolean("scaleWithDoc", true);
                alignWithMargins = c.GetOptionalBoolean("alignWithMargins", true);
                _oddHeader = c.ReadOptionalElementString("oddHeader");
                oddFooter = c.ReadOptionalElementString("oddFooter");
                evenHeader = c.ReadOptionalElementString("evenHeader");
                evenFooter = c.ReadOptionalElementString("evenFooter");
                _firstHeader = c.ReadOptionalElementString("firstHeader");
                _firstFooter = c.ReadOptionalElementString("firstFooter");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("headerFooter"))
            {
                c.SetOptionalBoolean("differentOddEven", _differentOddEven, false);
                c.SetOptionalBoolean("differentFirst", _differentFirst, false);
                c.SetOptionalBoolean("scaleWithDoc", scaleWithDoc, true);
                c.SetOptionalBoolean("alignWithMargins", alignWithMargins, true);
                c.WriteOptionalString("oddHeader", _oddHeader);
                c.WriteOptionalString("oddFooter", oddFooter);
                c.WriteOptionalString("evenHeader", evenHeader);
                c.WriteOptionalString("evenFooter", evenFooter);
                c.WriteOptionalString("firstHeader", _firstHeader);
                c.WriteOptionalString("firstFooter", _firstFooter);
            }
        }

        #endregion

        private bool alignWithMargins = true;

	public bool AlignWithMargins
	{
		get { return alignWithMargins;}
		set { alignWithMargins = value;}
	}


        private bool scaleWithDoc = true;

        public bool ScaleWithDoc
        {
            get { return scaleWithDoc; }
            set { scaleWithDoc = value; }
        }
	

        private bool _differentFirst;

        public bool DifferentFirst
        {
            get { return _differentFirst; }
            set { _differentFirst = value; }
        }
	

        private bool _differentOddEven;

        public bool DiffentOddEvent
        {
            get { return _differentOddEven; }
            set { _differentOddEven = value; }
        }
	

        private string _oddHeader;

        public string OddHeader
        {
            get { return _oddHeader; }
            set { _oddHeader = value; }
        }
        private string oddFooter;

        public string OddFooter
        {
            get { return oddFooter; }
            set { oddFooter = value; }
        }
        private string evenHeader;

        public string EvenHeader
        {
            get { return evenHeader; }
            set { evenHeader = value; }
        }
        private string evenFooter;

        public string EvenFooter
        {
            get { return evenFooter; }
            set { evenFooter = value; }
        }
        private string _firstHeader;

        public string FirstHeader
        {
            get { return _firstHeader; }
            set { _firstHeader = value; }
        }
        private string _firstFooter;

        public string FirstFooter
        {
            get { return _firstFooter; }
            set { _firstFooter = value; }
        }
	
	
	
	
	
	
    }
}
